<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>qLibc: extensions/qaconf.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">qLibc
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('qaconf_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">qaconf.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Apache-style configuration file parser.  
<a href="#details">More...</a></p>

<p><a href="qaconf_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ac28c668ae735bb483d2c61c59f54cae0"><td class="memItemLeft" align="right" valign="top">qaconf_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a> (void)</td></tr>
<tr class="memdesc:ac28c668ae735bb483d2c61c59f54cae0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new configuration object.  <a href="#ac28c668ae735bb483d2c61c59f54cae0">More...</a><br/></td></tr>
<tr class="separator:ac28c668ae735bb483d2c61c59f54cae0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b7d9693f31e326b134f03f8ee4bca09"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qaconf_8c.html#a4b7d9693f31e326b134f03f8ee4bca09">addoptions</a> (qaconf_t *<a class="el" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>, const qaconf_option_t *options)</td></tr>
<tr class="memdesc:a4b7d9693f31e326b134f03f8ee4bca09"><td class="mdescLeft">&#160;</td><td class="mdescRight">qaconf_t-&gt;<a class="el" href="qaconf_8c.html#a4b7d9693f31e326b134f03f8ee4bca09" title="qaconf_t-&gt;addoptions(): Register option directives. ">addoptions()</a>: Register option directives.  <a href="#a4b7d9693f31e326b134f03f8ee4bca09">More...</a><br/></td></tr>
<tr class="separator:a4b7d9693f31e326b134f03f8ee4bca09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a440db32385534bf03f08de253737623b"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qaconf_8c.html#a440db32385534bf03f08de253737623b">setdefhandler</a> (qaconf_t *<a class="el" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>, qaconf_cb_t *callback)</td></tr>
<tr class="memdesc:a440db32385534bf03f08de253737623b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set default callback function.  <a href="#a440db32385534bf03f08de253737623b">More...</a><br/></td></tr>
<tr class="separator:a440db32385534bf03f08de253737623b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab68c8ab80781fbca3aeaf7e3d16a9cc2"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qaconf_8c.html#ab68c8ab80781fbca3aeaf7e3d16a9cc2">setuserdata</a> (qaconf_t *<a class="el" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>, const void *userdata)</td></tr>
<tr class="memdesc:ab68c8ab80781fbca3aeaf7e3d16a9cc2"><td class="mdescLeft">&#160;</td><td class="mdescRight">qaconf_t-&gt;<a class="el" href="qaconf_8c.html#ab68c8ab80781fbca3aeaf7e3d16a9cc2" title="qaconf_t-&gt;setuserdata(): Set userdata which will be provided on callback. ">setuserdata()</a>: Set userdata which will be provided on callback.  <a href="#ab68c8ab80781fbca3aeaf7e3d16a9cc2">More...</a><br/></td></tr>
<tr class="separator:ab68c8ab80781fbca3aeaf7e3d16a9cc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ee9ebbb7719b530a788d2d01256b2cc"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qaconf_8c.html#a1ee9ebbb7719b530a788d2d01256b2cc">parse</a> (qaconf_t *<a class="el" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>, const char *filepath, uint8_t flags)</td></tr>
<tr class="memdesc:a1ee9ebbb7719b530a788d2d01256b2cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">qaconf_t-&gt;<a class="el" href="qaconf_8c.html#a1ee9ebbb7719b530a788d2d01256b2cc" title="qaconf_t-&gt;parse(): Run parser. ">parse()</a>: Run parser.  <a href="#a1ee9ebbb7719b530a788d2d01256b2cc">More...</a><br/></td></tr>
<tr class="separator:a1ee9ebbb7719b530a788d2d01256b2cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c09256d455a4cf7443aca42bccdf0e0"><td class="memItemLeft" align="right" valign="top">static const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qaconf_8c.html#a5c09256d455a4cf7443aca42bccdf0e0">errmsg</a> (qaconf_t *<a class="el" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>)</td></tr>
<tr class="memdesc:a5c09256d455a4cf7443aca42bccdf0e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">qaconf_t-&gt;<a class="el" href="qaconf_8c.html#a5c09256d455a4cf7443aca42bccdf0e0" title="qaconf_t-&gt;errmsg(): Get last error message. ">errmsg()</a>: Get last error message.  <a href="#a5c09256d455a4cf7443aca42bccdf0e0">More...</a><br/></td></tr>
<tr class="separator:a5c09256d455a4cf7443aca42bccdf0e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abad17eff2cc816719fdba22f271b0aab"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qaconf_8c.html#abad17eff2cc816719fdba22f271b0aab">reseterror</a> (qaconf_t *<a class="el" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>)</td></tr>
<tr class="memdesc:abad17eff2cc816719fdba22f271b0aab"><td class="mdescLeft">&#160;</td><td class="mdescRight">qaconf_t-&gt;<a class="el" href="qaconf_8c.html#abad17eff2cc816719fdba22f271b0aab" title="qaconf_t-&gt;reseterror(): Clear error message. ">reseterror()</a>: Clear error message.  <a href="#abad17eff2cc816719fdba22f271b0aab">More...</a><br/></td></tr>
<tr class="separator:abad17eff2cc816719fdba22f271b0aab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfcdc4a8d1067527f4c2d99b29d0db39"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qaconf_8c.html#abfcdc4a8d1067527f4c2d99b29d0db39">free_</a> (qaconf_t *<a class="el" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>)</td></tr>
<tr class="memdesc:abfcdc4a8d1067527f4c2d99b29d0db39"><td class="mdescLeft">&#160;</td><td class="mdescRight">qaconf_t-&gt;free(): Release resources.  <a href="#abfcdc4a8d1067527f4c2d99b29d0db39">More...</a><br/></td></tr>
<tr class="separator:abfcdc4a8d1067527f4c2d99b29d0db39"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Apache-style configuration file parser. </p>
<p>Apache-style Configuration is a configuration file syntax and format originally introduced by Apache HTTPd project. This format is powerful, flexible and human friendly. Even though this code gets distributed as a part of qLibc project, the code is written not to have any external dependencies to make this single file stands alone for better portability. It is purely written from the ground up and dedicated to the public by Seungyoung Kim.</p>
<p>Sample Apache-style Configuration Syntax: </p>
<div class="fragment"><div class="line"><span class="preprocessor"># Lines that begin with the hash character &quot;#&quot; are considered comments.</span></div>
<div class="line"><span class="preprocessor"></span>Listen 53</div>
<div class="line">Protocols UDP TCP</div>
<div class="line">IPSEC On</div>
<div class="line"></div>
<div class="line">&lt;Domain <span class="stringliteral">&quot;qdecoder.org&quot;</span>&gt;</div>
<div class="line">  TTL 86400</div>
<div class="line">  MX 10 mail.qdecoder.org</div>
<div class="line"></div>
<div class="line">  &lt;Host mail&gt;</div>
<div class="line">     IPv4 192.168.10.1</div>
<div class="line">     TXT <span class="stringliteral">&quot;US Rack-13D-18 \&quot;San Jose&#39;s\&quot;&quot;</span></div>
<div class="line">  &lt;/Host&gt;</div>
<div class="line"></div>
<div class="line">  &lt;Host www&gt;</div>
<div class="line">     IPv4 192.168.10.2</div>
<div class="line">     TXT <span class="stringliteral">&#39;KR Rack-48H-31 &quot;Seoul\&#39;s&quot;&#39;</span></div>
<div class="line">     TTL 3600</div>
<div class="line">  &lt;/Host&gt;</div>
<div class="line">&lt;/Domain&gt;</div>
<div class="line"></div>
<div class="line">&lt;Domain <span class="stringliteral">&quot;ringfs.org&quot;</span>&gt;</div>
<div class="line">  &lt;Host www&gt;</div>
<div class="line">     CNAME www.qdecoder.org</div>
<div class="line">  &lt;/Host&gt;</div>
<div class="line">&lt;/Domain&gt;</div>
</div><!-- fragment --><div class="fragment"><div class="line"><span class="comment">// THIS EXAMPLE CODE CAN BE FOUND IN EXAMPLES DIRECTORY.</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// Define scope.</span></div>
<div class="line"><span class="comment">//   QAC_SCOPE_ALL and QAC_SCOPE_ROOT are predefined.</span></div>
<div class="line"><span class="comment">//   Custum scope should be defined from 2(1 &lt;&lt; 1).</span></div>
<div class="line"><span class="comment">//   Note) These values are ORed(bit operation), so the number should be</span></div>
<div class="line"><span class="comment">//         2(1&lt;&lt;1), 4(1&lt;&lt;2), 6(1&lt;&lt;3), 8(1&lt;&lt;4), ...</span></div>
<div class="line"><span class="keyword">enum</span> {</div>
<div class="line">  OPT_SECTION_ALL        = QAC_SECTION_ALL,   <span class="comment">// pre-defined</span></div>
<div class="line">  OPT_SECTION_ROOT       = QAC_SECTION_ROOT,  <span class="comment">// pre-defined</span></div>
<div class="line">  OPT_SECTION_DOMAIN     = (1 &lt;&lt; 1),    <span class="comment">// user-defined section</span></div>
<div class="line">  OPT_SECTION_HOST       = (1 &lt;&lt; 2),    <span class="comment">// user-defined section</span></div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">// Define callback proto-types.</span></div>
<div class="line"><span class="keyword">static</span> QAC_CB(confcb_debug);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Define options and callbacks.</span></div>
<div class="line"><span class="keyword">static</span> qaconf_option_t options[] = {</div>
<div class="line">  {<span class="stringliteral">&quot;Listen&quot;</span>, QAC_TAKE_INT, confcb_debug, 0, OPT_SECTION_ALL},</div>
<div class="line">  {<span class="stringliteral">&quot;Protocols&quot;</span>, QAC_TAKEALL, confcb_debug, 0, OPT_SECTION_ROOT},</div>
<div class="line">  {<span class="stringliteral">&quot;IPSEC&quot;</span>, QAC_TAKE_BOOL, confcb_debug, 0, OPT_SECTION_ROOT},</div>
<div class="line">  {<span class="stringliteral">&quot;Domain&quot;</span>, QAC_TAKE_STR, confcb_debug, OPT_SECTION_DOMAIN, OPT_SECTION_ROOT},</div>
<div class="line">  {  <span class="stringliteral">&quot;TTL&quot;</span>, QAC_TAKE_INT, confcb_debug, 0, OPT_SECTION_DOMAIN | OPT_SECTION_HOST},</div>
<div class="line">  {  <span class="stringliteral">&quot;MX&quot;</span>, QAC_TAKE2 | QAC_A1_INT, confcb_debug, 0, OPT_SECTION_DOMAIN},</div>
<div class="line">  {  <span class="stringliteral">&quot;Host&quot;</span>, QAC_TAKE_STR, confcb_debug, OPT_SECTION_HOST, OPT_SECTION_DOMAIN},</div>
<div class="line">  {    <span class="stringliteral">&quot;IPv4&quot;</span>, QAC_TAKE_STR, confcb_debug, 0, OPT_SECTION_HOST},</div>
<div class="line">  {    <span class="stringliteral">&quot;TXT&quot;</span>, QAC_TAKE_STR, confcb_debug, 0, OPT_SECTION_HOST},</div>
<div class="line">  {    <span class="stringliteral">&quot;CNAME&quot;</span>, QAC_TAKE_STR, confcb_debug, 0, OPT_SECTION_HOST},</div>
<div class="line">  QAC_OPTION_END</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> user_main(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">  <span class="comment">// Create a userdata structure.</span></div>
<div class="line">  <span class="keyword">struct </span>MyConf myconf;</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Initialize and create a qaconf object.</span></div>
<div class="line">  qaconf_t *conf = <a class="code" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>();</div>
<div class="line">  <span class="keywordflow">if</span> (conf == NULL) {</div>
<div class="line">    printf(<span class="stringliteral">&quot;Failed to open &#39;&quot;</span> CONF_PATH <span class="stringliteral">&quot;&#39;.\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> -1;</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Register options.</span></div>
<div class="line">  conf-&gt;addoptions(conf, options);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Set callback userdata</span></div>
<div class="line">  <span class="comment">// This is a userdata which will be provided on callback</span></div>
<div class="line">  conf-&gt;setuserdata(conf, &amp;myconf);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Run parser.</span></div>
<div class="line">  <span class="keywordtype">int</span> count = conf-&gt;parse(conf, CONF_PATH, QAC_CASEINSENSITIVE);</div>
<div class="line">  <span class="keywordflow">if</span> (count &lt; 0) {</div>
<div class="line">    printf(<span class="stringliteral">&quot;Error: %s\n&quot;</span>, conf-&gt;errmsg(conf));</div>
<div class="line">  } <span class="keywordflow">else</span> {</div>
<div class="line">    printf(<span class="stringliteral">&quot;Successfully loaded.\n&quot;</span>);</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Verify userdata structure.</span></div>
<div class="line">  <span class="keywordflow">if</span> (conf-&gt;errmsg(conf) == NULL) {  <span class="comment">// another way to check parsing error.</span></div>
<div class="line">    <span class="comment">// codes here</span></div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Release resources.</span></div>
<div class="line">  conf-&gt;free(conf);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keyword">static</span> QAC_CB(confcb_debug)</div>
<div class="line">{</div>
<div class="line">  <span class="keywordtype">int</span> i;</div>
<div class="line">  <span class="keywordflow">for</span> (i = 0; i &lt; data-&gt;level; i++) {</div>
<div class="line">    printf (<span class="stringliteral">&quot;    &quot;</span>);</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Print option name</span></div>
<div class="line">  <span class="keywordflow">if</span> (data-&gt;otype == QAC_OTYPE_SECTIONOPEN) {</div>
<div class="line">    printf(<span class="stringliteral">&quot;&lt;%s&gt;&quot;</span>, data-&gt;argv[0]);</div>
<div class="line">  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (data-&gt;otype == QAC_OTYPE_SECTIONCLOSE) {</div>
<div class="line">    printf(<span class="stringliteral">&quot;&lt;/%s&gt;&quot;</span>, data-&gt;argv[0]);</div>
<div class="line">  } <span class="keywordflow">else</span> {  <span class="comment">// This is QAC_OTYPE_OPTION type.</span></div>
<div class="line">    printf(<span class="stringliteral">&quot;%s&quot;</span>, data-&gt;argv[0]);</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Print parent names</span></div>
<div class="line">  qaconf_cbdata_t *parent;</div>
<div class="line">  <span class="keywordflow">for</span> (parent = data-&gt;parent; parent != NULL; parent = parent-&gt;parent) {</div>
<div class="line">    printf(<span class="stringliteral">&quot; ::%s(%s)&quot;</span>, parent-&gt;argv[0], parent-&gt;argv[1]);</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Print option arguments</span></div>
<div class="line">  <span class="keywordflow">for</span> (i = 1; i &lt; data-&gt;argc; i++) {</div>
<div class="line">    printf(<span class="stringliteral">&quot; [%d:%s]&quot;</span>, i, data-&gt;argv[i]);</div>
<div class="line">  }</div>
<div class="line">  printf(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Return OK</span></div>
<div class="line">  <span class="keywordflow">return</span> NULL;</div>
<div class="line">}</div>
</div><!-- fragment --><div class="fragment"><div class="line">[Output]</div>
<div class="line">Listen [1:53]</div>
<div class="line">Protocols [1:UDP] [2:TCP]</div>
<div class="line">IPSEC [1:1]</div>
<div class="line">&lt;Domain&gt; [1:qdecoder.org]</div>
<div class="line">    TTL ::Domain(qdecoder.org) [1:86400]</div>
<div class="line">    MX ::Domain(qdecoder.org) [1:10] [2:mail.qdecoder.org]</div>
<div class="line">    &lt;Host&gt; ::Domain(qdecoder.org) [1:mail]</div>
<div class="line">        IPv4 ::Host(mail) ::Domain(qdecoder.org) [1:192.168.10.1]</div>
<div class="line">        TXT ::Host(mail) ::Domain(qdecoder.org) [1:US Rack-13D-18 <span class="stringliteral">&quot;San Jose&#39;s&quot;</span>]</div>
<div class="line">    &lt;/Host&gt; ::Domain(qdecoder.org) [1:mail]</div>
<div class="line">    &lt;Host&gt; ::Domain(qdecoder.org) [1:www]</div>
<div class="line">        IPv4 ::Host(www) ::Domain(qdecoder.org) [1:192.168.10.2]</div>
<div class="line">        TXT ::Host(www) ::Domain(qdecoder.org) [1:KR Rack-48H-31 <span class="stringliteral">&quot;Seoul&#39;s&quot;</span>]</div>
<div class="line">        TTL ::Host(www) ::Domain(qdecoder.org) [1:3600]</div>
<div class="line">    &lt;/Host&gt; ::Domain(qdecoder.org) [1:www]</div>
<div class="line">&lt;/Domain&gt; [1:qdecoder.org]</div>
<div class="line">&lt;Domain&gt; [1:ringfs.org]</div>
<div class="line">    &lt;Host&gt; ::Domain(ringfs.org) [1:www]</div>
<div class="line">        CNAME ::Host(www) ::Domain(ringfs.org) [1:www.qdecoder.org]</div>
<div class="line">    &lt;/Host&gt; ::Domain(ringfs.org) [1:www]</div>
<div class="line">&lt;/Domain&gt; [1:ringfs.org]</div>
<div class="line">Successfully loaded.</div>
</div><!-- fragment --> 
<p>Definition in file <a class="el" href="qaconf_8c_source.html">qaconf.c</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ac28c668ae735bb483d2c61c59f54cae0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">qaconf_t* qaconf </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new configuration object. </p>
<dl class="section return"><dt>Returns</dt><dd>a pointer of new qaconf_t object.</dd></dl>
<div class="fragment"><div class="line">qaconf_t *conf = <a class="code" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>();</div>
<div class="line"><span class="keywordflow">if</span> (conf == NULL) {</div>
<div class="line">  <span class="comment">// Insufficient memory.</span></div>
<div class="line">}</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qaconf_8c_source.html#l00245">245</a> of file <a class="el" href="qaconf_8c_source.html">qaconf.c</a>.</p>

</div>
</div>
<a class="anchor" id="a4b7d9693f31e326b134f03f8ee4bca09"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int addoptions </td>
          <td>(</td>
          <td class="paramtype">qaconf_t *&#160;</td>
          <td class="paramname"><em>qaconf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const qaconf_option_t *&#160;</td>
          <td class="paramname"><em>options</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qaconf_t-&gt;<a class="el" href="qaconf_8c.html#a4b7d9693f31e326b134f03f8ee4bca09" title="qaconf_t-&gt;addoptions(): Register option directives. ">addoptions()</a>: Register option directives. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qaconf</td><td>qaconf_t object. </td></tr>
    <tr><td class="paramname">options</td><td>array pointer of qaconf_option_t.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a number of options registered(added).</dd></dl>
<div class="fragment"><div class="line">qaconf_option_t options[] = {</div>
<div class="line">   {<span class="stringliteral">&quot;Listen&quot;</span>, QAC_TAKE_INT, confcb_debug, 0, OPT_SECTION_ALL},</div>
<div class="line">   {<span class="stringliteral">&quot;Protocols&quot;</span>, QAC_TAKEALL, confcb_debug, 0, OPT_SECTION_ROOT},</div>
<div class="line">   {<span class="stringliteral">&quot;IPSEC&quot;</span>, QAC_TAKE_BOOL, confcb_debug, 0, OPT_SECTION_ROOT},</div>
<div class="line">   {<span class="stringliteral">&quot;Domain&quot;</span>, QAC_TAKE_STR, confcb_debug, OPT_SECTION_DOMAIN, OPT_SECTION_ROOT},</div>
<div class="line">   {  <span class="stringliteral">&quot;TTL&quot;</span>, QAC_TAKE_INT, confcb_debug, 0, OPT_SECTION_DOMAIN | OPT_SECTION_HOST},</div>
<div class="line">   {  <span class="stringliteral">&quot;MX&quot;</span>, QAC_TAKE2 | QAC_A1_INT, confcb_debug, 0, OPT_SECTION_DOMAIN},</div>
<div class="line">   {  <span class="stringliteral">&quot;Host&quot;</span>, QAC_TAKE_STR, confcb_debug, OPT_SECTION_HOST, OPT_SECTION_DOMAIN},</div>
<div class="line">   {    <span class="stringliteral">&quot;IPv4&quot;</span>, QAC_TAKE_STR, confcb_debug, 0, OPT_SECTION_HOST},</div>
<div class="line">   {    <span class="stringliteral">&quot;TXT&quot;</span>, QAC_TAKE_STR, confcb_debug, 0, OPT_SECTION_HOST},</div>
<div class="line">   {    <span class="stringliteral">&quot;CNAME&quot;</span>, QAC_TAKE_STR, confcb_debug, 0, OPT_SECTION_HOST},</div>
<div class="line">   QAC_OPTION_END</div>
<div class="line"> };</div>
<div class="line"></div>
<div class="line"> <span class="comment">// Register options.</span></div>
<div class="line"> qaconf_t *conf = <a class="code" href="qaconf_8c.html#ac28c668ae735bb483d2c61c59f54cae0">qaconf</a>();</div>
<div class="line"> conf-&gt;addoptions(conf, options);</div>
<div class="line"> (...codes goes...)</div>
</div><!-- fragment --><p>It takes an array of options as provided in the sample codes. Each option consists of 5 parameters as below</p>
<div class="fragment"><div class="line">1st) Option Name : A option directive name.</div>
<div class="line">2nd) Arguments   : A number of arguments <span class="keyword">this</span> option takes and their types.</div>
<div class="line">3rd) Callback    : A <span class="keyword">function</span> pointer <span class="keywordflow">for</span> callback.</div>
<div class="line">4th) Section ID  : Section ID <span class="keywordflow">if</span> <span class="keyword">this</span> option is a section like &lt;Option&gt;.</div>
<div class="line">              Otherwise 0 <span class="keywordflow">for</span> regular option.</div>
<div class="line">5th) Sections    : ORed section IDs where <span class="keyword">this</span> option can be specified.</div>
</div><!-- fragment --><p>Example:</p>
<div class="fragment"><div class="line">{<span class="stringliteral">&quot;TTL&quot;</span>, QAC_TAKE_INT, confcb_debug, 0, OPT_SECTION_DOMAIN | OPT_SECTION_HOST}</div>
<div class="line">  1st) Option name is <span class="stringliteral">&quot;TTL&quot;</span></div>
<div class="line">  2nd) It takes 1 argument and its type must be integer.</div>
<div class="line">  3rd) Callback <span class="keyword">function</span>, confcb_debug, will be called.</div>
<div class="line">  4th) This is a regular option and does not have section <span class="keywordtype">id</span>.</div>
<div class="line">  5th) This option can be specified in OPT_SECTION_DOMAIN and OPT_SECTION_HOST.</div>
</div><!-- fragment --><p>OPTION NAME field:</p>
<p>Option name is a unique string. Even an option is section type like &lt;option&gt; only name part without bracket needs to be specifed.</p>
<p>ARGUMENT field:</p>
<p>This field is for providing argument checking in parser level. So in user's callback routine can go simple. This provides checking of number of arguments this option can take and those argument type.</p>
<p>In terms of argument types. There are 4 argument types as below. And first 5 arguments can be checked individually with different types.</p>
<div class="fragment"><div class="line">STR type   : any type</div>
<div class="line">INT type   : integer type. ex) 23, -12, 0</div>
<div class="line">FLOAT type : integer + floating point type. ex) 1.32, -32.5, 23, -12, 0</div>
<div class="line">BOOL type  : <span class="keywordtype">bool</span> type ex) 1/0, <span class="keyword">true</span>/<span class="keyword">false</span>, on/off, yes/no</div>
</div><!-- fragment --><p>When a BOOL type is specified, the argument passed to callback will be replaced to "1" or "0" for convenience use. For example, if "On" is specified as a argument and if BOOL type checking is specified, then actual argument which will be passed to callback will have "1". So we can simply determine it like "bool enabled = atoi(data-&gt;argv[1])".</p>
<p>If original input argument needs to be passed to callback, specify STR type.</p>
<p>Here is some examples of how to specify "Arguments" field.</p>
<div class="fragment"><div class="line">An option takes 1 argument.</div>
<div class="line">  QAC_TAKE_STR    &lt;= String(any) type</div>
<div class="line">  QAC_TAKE_INT    &lt;= Integer type</div>
<div class="line">  QAC_TAKE_FLOAT  &lt;= Float type</div>
<div class="line">  QAC_TAKE_BOOL   &lt;= Bool type</div>
<div class="line"></div>
<div class="line">  QAC_TAKE1               &lt;= Equavalent to QAC_TAKE_STR</div>
<div class="line">  QAC_TAKE1 | QAC_A1_BOOL &lt;= Equavalent to QAC_TAKE_BOOL</div>
<div class="line"></div>
<div class="line">An option takes 2 arguments, <span class="keywordtype">bool</span> and <span class="keywordtype">float</span>.</div>
<div class="line">  QAC_TAKE2 | QAC_A1_BOOL | QAC_A2_FLOAT</div>
<div class="line"></div>
<div class="line">An option takes any number of arguments in any type.</div>
<div class="line">  QAC_TAKEALL</div>
<div class="line"></div>
<div class="line">An option takes any number of arguments but 1st one must be <span class="keywordtype">bool</span> and</div>
<div class="line">2nd one must be integer and rest of them must be <span class="keywordtype">float</span>.</div>
<div class="line">  QAC_TAKEALL | QAC_A1_BOOL | QAC_A2_INT | QAC_AA_FLOAT</div>
</div><!-- fragment --><p>CALLBACK field:</p>
<p>User defined callback function. We provide a macro, QAC_CB, for function proto type. Always use QAC_CB macro.</p>
<div class="fragment"><div class="line">QAC_CB(sample_cb) {</div>
<div class="line">  (...codes...)</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">is equavalent to</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">char</span> *sample_cb(qaconf_cbdata_t *data, <span class="keywordtype">void</span> *userdata) {</div>
<div class="line">  (...codes...)</div>
<div class="line">}</div>
</div><!-- fragment --><p>Callback function will be called with 2 arguments. One is callback data and the other one is userdata. Userdata is the data pointer set by <a class="el" href="qaconf_8c.html#ab68c8ab80781fbca3aeaf7e3d16a9cc2" title="qaconf_t-&gt;setuserdata(): Set userdata which will be provided on callback. ">setuserdata()</a>.</p>
<p>Here is data structure. Arguments belong to the option can be accessed via argv variables like data-&gt;argv[1]. argv[0] is for the option name.</p>
<div class="fragment"><div class="line"><span class="keyword">struct </span>qaconf_cbdata_s {</div>
<div class="line">  <span class="keyword">enum</span> qaconf_otype otype;  <span class="comment">// option type</span></div>
<div class="line">  uint64_t section;         <span class="comment">// current section where this option is located</span></div>
<div class="line">  uint64_t sections;        <span class="comment">// ORed all parent&#39;s sectionid(s) including current sections</span></div>
<div class="line">  uint8_t level;            <span class="comment">// number of parents(level), root level is 0</span></div>
<div class="line">  qaconf_cbdata_t *parent;  <span class="comment">// upper parent link</span></div>
<div class="line"></div>
<div class="line">  <span class="keywordtype">int</span> argc;       <span class="comment">// number arguments. always equal or greater than 1.</span></div>
<div class="line">  <span class="keywordtype">char</span> **argv;    <span class="comment">// argument pointers. argv[0] is option name.</span></div>
<div class="line">}</div>
</div><!-- fragment --><p>SECTION ID field:</p>
<p>If an option is an section like &lt;Option&gt;, section id can be assigned. This section id can be used to limit some other option directives to be located only inside of that section. So this is your choice. If it doesn't require to check directory scope, we can just specify 0 here.</p>
<p>There are 2 pre-defined section id, QAC_SECTION_ALL and QAC_SECTION_ROOT. When we define user section, it has to be defined from 2(1 &lt;&lt; 1)as below.</p>
<div class="fragment"><div class="line"><span class="keyword">enum</span> {</div>
<div class="line">  OPT_SECTION_ALL        = QAC_SECTION_ALL,   <span class="comment">// pre-defined</span></div>
<div class="line">  OPT_SECTION_ROOT       = QAC_SECTION_ROOT,  <span class="comment">// pre-defined</span></div>
<div class="line">  OPT_SECTION_DOMAIN     = (1 &lt;&lt; 1),    <span class="comment">// user-defined section</span></div>
<div class="line">  OPT_SECTION_HOST       = (1 &lt;&lt; 2),    <span class="comment">// user-defined section</span></div>
<div class="line">};</div>
</div><!-- fragment --><p>Please note that this section IDs are ORed. So the section id should be assigned in bit operation manner as 2(1&lt;&lt;1), 4(1&lt;&lt;2), 6(1&lt;&lt;3), 8(1&lt;&lt;4), ...</p>
<p>SECTION IDS field:</p>
<p>This field is to limit the scope where an option is allowed to be specified. Multiple section IDs can be ORed.</p>
<p>QAC_SECTION_ALL means an option can be appeared in anywhere.</p>
<p>QAC_SECTION_ROOT means an option can be appeared only in top level and not inside of any sections. </p>

<p>Definition at line <a class="el" href="qaconf_8c_source.html#l00438">438</a> of file <a class="el" href="qaconf_8c_source.html">qaconf.c</a>.</p>

</div>
</div>
<a class="anchor" id="a440db32385534bf03f08de253737623b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void setdefhandler </td>
          <td>(</td>
          <td class="paramtype">qaconf_t *&#160;</td>
          <td class="paramname"><em>qaconf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qaconf_cb_t *&#160;</td>
          <td class="paramname"><em>callback</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set default callback function. </p>
<p>Default callback function will be called for unregistered option directives. QAC_IGNOREUNKNOWN flag will be ignored when default callback has set.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qaconf</td><td>qaconf_t object. </td></tr>
    <tr><td class="paramname">callback</td><td>callback function pointer </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="qaconf_8c_source.html#l00470">470</a> of file <a class="el" href="qaconf_8c_source.html">qaconf.c</a>.</p>

</div>
</div>
<a class="anchor" id="ab68c8ab80781fbca3aeaf7e3d16a9cc2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void setuserdata </td>
          <td>(</td>
          <td class="paramtype">qaconf_t *&#160;</td>
          <td class="paramname"><em>qaconf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>userdata</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qaconf_t-&gt;<a class="el" href="qaconf_8c.html#ab68c8ab80781fbca3aeaf7e3d16a9cc2" title="qaconf_t-&gt;setuserdata(): Set userdata which will be provided on callback. ">setuserdata()</a>: Set userdata which will be provided on callback. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qaconf</td><td>qaconf_t object. </td></tr>
    <tr><td class="paramname">userdata</td><td>a pointer of userdata.</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><span class="comment">// Define an example userdata</span></div>
<div class="line"><span class="keyword">struct </span>MyConf {</div>
<div class="line">  <span class="keywordtype">int</span> sample;</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> user_main(<span class="keywordtype">void</span>) {</div>
<div class="line">  <span class="keyword">struct </span>MyConf myconf;</div>
<div class="line"></div>
<div class="line">  (...codes...)</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Set callback userdata.</span></div>
<div class="line">  conf-&gt;<a class="code" href="qaconf_8c.html#ab68c8ab80781fbca3aeaf7e3d16a9cc2">setuserdata</a>(conf, &amp;myconf);</div>
<div class="line">  (...codes...)</div>
<div class="line"> }</div>
<div class="line"></div>
<div class="line">QAC_CB(confcb_callback_func) {</div>
<div class="line">  (...codes...)</div>
<div class="line">   <span class="comment">// Type casting userdata for convenient use.</span></div>
<div class="line">   <span class="keyword">struct </span>MyConf *myconf = (<span class="keyword">struct </span>MyConf *)userdata;</div>
<div class="line">   myconf-&gt;sample++;</div>
<div class="line">  (...codes...)</div>
<div class="line">  <span class="keywordflow">return</span> NULL;</div>
<div class="line">}</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qaconf_8c_source.html#l00506">506</a> of file <a class="el" href="qaconf_8c_source.html">qaconf.c</a>.</p>

</div>
</div>
<a class="anchor" id="a1ee9ebbb7719b530a788d2d01256b2cc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int parse </td>
          <td>(</td>
          <td class="paramtype">qaconf_t *&#160;</td>
          <td class="paramname"><em>qaconf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filepath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qaconf_t-&gt;<a class="el" href="qaconf_8c.html#a1ee9ebbb7719b530a788d2d01256b2cc" title="qaconf_t-&gt;parse(): Run parser. ">parse()</a>: Run parser. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qaconf</td><td>qaconf_t object. </td></tr>
    <tr><td class="paramname">filepath</td><td>configuration file path. </td></tr>
    <tr><td class="paramname">flags</td><td>parser options. (0 for default)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A number of option directives parsed. -1 will be returned in case of error.</dd></dl>
<p>Here is a list of flags. Multiple flags can be ORed.</p>
<p>QAC_CASEINSENSITIVE: Option name is case-insensitive.</p>
<p>QAC_IGNOREUNKNOWN : Ignore unknown option directives. This flag will be ignored if <a class="el" href="qaconf_8c.html#a440db32385534bf03f08de253737623b" title="Set default callback function. ">setdefhandler()</a> has set.</p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> c;</div>
<div class="line">c = conf-&gt;parse(conf, <span class="stringliteral">&quot;sm1.conf&quot;</span>, 0);</div>
<div class="line">c = conf-&gt;parse(conf, <span class="stringliteral">&quot;sm2.conf&quot;</span>, QAC_CASEINSENSITIVE);</div>
<div class="line">c = conf-&gt;parse(conf, <span class="stringliteral">&quot;sm3.conf&quot;</span>, QAC_CASEINSENSITIVE | QAC_IGNOREUNKNOWN);</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qaconf_8c_source.html#l00534">534</a> of file <a class="el" href="qaconf_8c_source.html">qaconf.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5c09256d455a4cf7443aca42bccdf0e0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static const char* errmsg </td>
          <td>(</td>
          <td class="paramtype">qaconf_t *&#160;</td>
          <td class="paramname"><em>qaconf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qaconf_t-&gt;<a class="el" href="qaconf_8c.html#a5c09256d455a4cf7443aca42bccdf0e0" title="qaconf_t-&gt;errmsg(): Get last error message. ">errmsg()</a>: Get last error message. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qaconf</td><td>qaconf_t object.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A const pointer of error message string.</dd></dl>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> c = conf-&gt;parse(conf, <span class="stringliteral">&quot;sample.conf&quot;</span>, 0);</div>
<div class="line"><span class="keywordflow">if</span> (c &lt; 0) {</div>
<div class="line">  <span class="comment">// ERROR</span></div>
<div class="line">  printf(<span class="stringliteral">&quot;%s\n&quot;</span>, conf-&gt;errmsg(conf));</div>
<div class="line">}</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qaconf_8c_source.html#l00572">572</a> of file <a class="el" href="qaconf_8c_source.html">qaconf.c</a>.</p>

</div>
</div>
<a class="anchor" id="abad17eff2cc816719fdba22f271b0aab"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void reseterror </td>
          <td>(</td>
          <td class="paramtype">qaconf_t *&#160;</td>
          <td class="paramname"><em>qaconf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qaconf_t-&gt;<a class="el" href="qaconf_8c.html#abad17eff2cc816719fdba22f271b0aab" title="qaconf_t-&gt;reseterror(): Clear error message. ">reseterror()</a>: Clear error message. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qaconf</td><td>qaconf_t object.</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line">conf-&gt;reseterror(conf);</div>
<div class="line">conf-&gt;parse(conf, <span class="stringliteral">&quot;sample.conf&quot;</span>, 0);</div>
<div class="line"><span class="keywordflow">if</span> (conf-&gt;errmsg(conf) != NULL) {</div>
<div class="line">  <span class="comment">// ERROR</span></div>
<div class="line">}</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qaconf_8c_source.html#l00589">589</a> of file <a class="el" href="qaconf_8c_source.html">qaconf.c</a>.</p>

</div>
</div>
<a class="anchor" id="abfcdc4a8d1067527f4c2d99b29d0db39"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void free_ </td>
          <td>(</td>
          <td class="paramtype">qaconf_t *&#160;</td>
          <td class="paramname"><em>qaconf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qaconf_t-&gt;free(): Release resources. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qaconf</td><td>qaconf_t object.</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line">conf-&gt;free(conf);</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qaconf_8c_source.html#l00605">605</a> of file <a class="el" href="qaconf_8c_source.html">qaconf.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_40c73bf2095fd0473b1b85ccdcac2768.html">extensions</a></li><li class="navelem"><a class="el" href="qaconf_8c.html">qaconf.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
